import http from '@/utils/http'

// 获取入住列表
export const getCheckInList = (params: { pageNum: number; pageSize: number }) => {
  return http.get('/checkin/list.do', { params })
}

// 获取在住客人
export const getCurrentGuests = (params: { pageNum: number; pageSize: number }) => {
  return http.get('/checkin/currentGuests.do', { params })
}

// 基于预订办理入住
export const checkInWithReservation = (reservationId: number) => {
  return http.post(`/checkin/checkInWithReservation/${reservationId}.do`)
}

// Walk-in入住
export const checkInWithoutReservation = (data: any) => {
  return http.post('/checkin/checkInWithoutReservation.do', data)
}

// 办理退房
export const checkOut = (data: { id: number; totalAmount: number }) => {
  return http.post('/checkin/checkOut.do', data.id, { params: { totalAmount: data.totalAmount } })
}

// 更新入住信息
export const updateCheckIn = (data: any) => {
  return http.post('/checkin/update.do', data)
}